package titt.service;

import titt.head.HTTPHead;
import titt.io.socket.TITTSocket;
import titt.util.io.pipe.PipeListener;

public class ServicePackage {

	public static final String PACK_ID = "PACK"; 
	
	private HTTPHead h;
	private TITTSocket ts;
	private String id, serviceID;
	private PipeListener l;
	
	public ServicePackage(String id, HTTPHead h, TITTSocket ts) {
		this.h = h;
		this.ts = ts;
		this.id = id;
		this.serviceID = id.split(PACK_ID)[0];
	}
	
	public ServicePackage(String id, HTTPHead h, TITTSocket ts, PipeListener l) {
		this(id,h,ts);
		this.l = l;
	}
	
	public String getPackageID() {
		return id;
	}
	
	public String getServiceID() {
		return serviceID;
	}
	
	public HTTPHead getHead() {
		return h;
	}
	
	public TITTSocket getTITTSocket() {
		return ts;
	}
	
	public PipeListener getAssociatedListener() {
		return l;
	}
	
}
